/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { TreeDataModel, TreeModel } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface FyArea extends TreeModel<FyArea> {
  areaCode?: string; // 区域编码
  areaName?: string; // 区域名称
  areaType?: string; // 区域类型
  areaFy?: string; // 法院
}

export const fyAreaList = (params?: FyArea | any) =>
  defHttp.get<FyArea>({ url: adminPath + '/operating/fyArea/list', params });

export const fyAreaListData = (params?: FyArea | any) =>
  defHttp.post<FyArea[]>({ url: adminPath + '/operating/fyArea/listData', params });

export const fyAreaForm = (params?: FyArea | any) =>
  defHttp.get<FyArea>({ url: adminPath + '/operating/fyArea/form', params });

export const fyAreaCreateNextNode = (params?: FyArea | any) =>
  defHttp.get<FyArea>({ url: adminPath + '/operating/fyArea/createNextNode', params });

export const fyAreaSave = (params?: any, data?: FyArea | any) =>
  defHttp.postJson<FyArea>({ url: adminPath + '/operating/fyArea/save', params, data });

export const fyAreaDelete = (params?: FyArea | any) =>
  defHttp.get<FyArea>({ url: adminPath + '/operating/fyArea/delete', params });

export const fyAreaTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/operating/fyArea/treeData', params });
